home *** CD-ROM | disk | FTP | other *** search
- ;OCL{{{}}}
- ;OCL{{{ comments
- ; macro that can be bound to mouse-keys to jump to the clicked position
- ; OCL variable ocl-argument is set to:
- ; 0 - no move
- ; 1 - y position or buffer changed
- ; 2 - x position changed
- ; 3 - x and y/buffer position changed
- ;OCL}}}
- @if-using not(ocl-file-go-mouse)
- @use (ocl-file-go-mouse)
- ;OCL{{{ go-mouse-position
- ( deffun go-mouse-position
- ( if and(not(in-prompt) >(mouse-outside -1))
- ;OCL{{{ do the move
- ( set ocl-argument 0
- ;OCL{{{ maybe switch buffer
- if <>(current-buffer-number mouse-buffer-number)
- ( goto-buffer-number mouse-buffer-number
- set ocl-argument 1
- )
- fi
- ;OCL}}}
- ;OCL{{{ go up down
- local
- ( mouse-go-y )
- (
- ;OCL{{{ maybe down
- while >(mouse-go-y 0)
- ( set mouse-go-y -(mouse-go-y 1)
- next-line
- set ocl-argument 1
- )
- ;OCL}}}
- ;OCL{{{ maybe up
- set mouse-go-y -(0 mouse-go-y)
- while >(mouse-go-y 0)
- ( set mouse-go-y -(mouse-go-y 1)
- previous-line
- set ocl-argument 1
- )
- ;OCL}}}
- )
- ;OCL}}}
- ;OCL{{{ go left/right
- if <>(mouse-x store-pos)
- ( set ocl-argument +(2 ocl-argument)
- goto-counter mouse-x
- )
- fi
- ;OCL}}}
- )
- ;OCL}}}
- fi
- )
- )
- ;OCL}}}
- @fi
-